Grokking Scalable Systems for Interviews
Rate this course
Ask Author
Contribute
Back to course home

4% completed

Vote For New Content
Introduction
Course Overview
Who This Course Is for
Caching
What Is Negative Caching and When Should You Cache 404 or Empty Results?
What Is the Difference Between Soft TTL and Hard TTL, and Why Does It Matter?
How Can a Bloom Filter Reduce Cache or Database Load?
What Is Distributed Locking for Cache Rebuilds, and How Does It Prevent Cache Stampedes?
Load Balancing
What Are Sticky Sessions (Session Affinity) and When Should I Avoid Them?
What Is the Difference between Liveness Checks and Readiness Checks in Load Balancers?
What is Global Server Load Balancing (GSLB) and How GeoDNS and Anycast Work?
API Basics
What are the Main API Pagination Strategies (offset, cursor, keyset), and When Should I Use Each?
What are HTTP Conditional Requests (ETag, If‑None‑Match, Last‑Modified) and How They Reduce Load?
What Is the Difference between Rate Limiting and Throttling and Quotas?
What Are Idempotency Keys and How to Implement Them Safely for Payments
Databases
What are SQL Isolation Levels (Read Committed, Repeatable Read, Serializable), and What Anomalies Do They Prevent?
What Is a Write‑Ahead Log (WAL), and How Does It Ensure Durability?
What Is the Difference Between Synchronous and Asynchronous Replication, and When Should I Use Read Replicas?
What Is MVCC (Multi‑Version Concurrency Control), and How Does It Enable Concurrent Reads and Writes?
What Are Safe Patterns for Online Schema Changes vs. Offline Migrations?
Scalability
What is Little’s Law and How to Use It for Quick Capacity Estimates in System Design
How Can I do Back-of-the-Envelope Sizing for QPS, Bandwidth, Storage, and Peak vs. Average Load?
What are Cold Starts and Warm Starts, and Why Do They Matter for Performance?
Sharding and Partitioning
How Do I Choose a Good Shard Key and Avoid Hotspots (Bucketing and Key Randomization)?
What Are Range Sharding, Directory‑Based Sharding, and Geo‑Sharding, and What Are the Common Use Cases?
What Is the Difference Between Rendezvous Hashing and Consistent Hashing, and When Should I Use Each?
Messaging and Streaming
What Do At‑most‑once, At‑least‑once, And Exactly‑once Delivery Semantics Mean?
What Are Idempotent Producers And Consumers, And How Do De‑duplication Keys Work?
What Is Message Ordering, How Do Partition Keys Affect It, And When Can Ordering Break?
What Are Windowing And Watermarking In Streaming Systems, In Simple Terms?
Consistency and Replication
What Is Quorum (N, R, W), And Why Does R + W > N Give Strongly Consistent Reads?
What Are Common Conflict Resolution Strategies (Last‑write‑wins, Vector Clocks, Logical Clocks)?
What Are Read Repair, Hinted Handoff, And Anti‑entropy (Merkle Trees) In Eventually Consistent Systems?
Observability
What Is The Difference Between SLI, SLO, And SLA, And Can You Give Simple Examples?
What Is Opentelemetry, And How Do Traces, Spans, Metrics, And Logs Fit Together?
What Is An Error Budget, And How Should It Guide Release Decisions?
Security
What Are The Trade‑offs Between Server‑stored Sessions And JWTs for Authentication?
What Is The Difference Between TLS And MTLS, And When Is MTLS Appropriate For Service‑to‑service Auth?
What Is Secrets Management, And How Do Environment Variables, KMS, And Vault Compare?
What Is A Replay Attack, And How Is It Different from Idempotency Issues?
Networking
What Are The Differences Between TCP, UDP, And QUIC, And When Should I Use Each?
What Is The Difference Between A Forward Proxy, A Reverse Proxy, And NAT?
What Changed From HTTP/1.1 To HTTP/2 To HTTP/3, And What Are Head‑of‑line Blocking And Multiplexing?
Storage
What Is the Difference Between Content‑Addressable Storage and Location‑Based Addressing?
What Are Checksums and Etags, and How Do MD5/SHA Compare to CRC for Integrity?
What Are Hot, Warm, Cold, and Archive Storage Tiers, and When Should I Use Each?
Design Patterns
What Is the Outbox Pattern, and How Does Change Data Capture (CDC) Work at a High Level?
What Is CQRS (Command Query Responsibility Segregation), and When Should I Consider It?
What Are the Differences Between a Circuit Breaker, Retry With Backoff, and Rate Limiting?
Reliability and Operations
What Are RPO and RTO, and How Do They Differ in Disaster Recovery Planning?
What Is the Difference Between Active‑Active and Active‑Passive Architectures?
What Is Graceful Degradation, and How Do Feature Flags Help Availability?
What Are the Differences Between UUID, ULID, KSUID, and Snowflake IDs, and How Do I Choose?
How Do Snowflake‑Style IDs Work (Timestamp, Worker, Sequence), and What Problems Do They Solve?
What Is the Difference Between Wall‑Clock Time and Monotonic Time, and Why Is Clock Skew Hard?
Final Words
Key Takeaways
What To Learn Next
What Is the Difference Between Active‑Active and Active‑Passive Architectures?

Active-active architecture involves multiple servers or nodes running simultaneously to share the workload and ensure continuous availability, whereas active-passive architecture has one primary active server with standby backups that only activate when the primary fails.

In both cases the goal is high reliability and minimal downtime, but each approach balances performance, cost, and complexity differently.

Active-active setups treat all machines as “hot” and load-balanced, while active-passive setups keep backups idle until needed.

These designs are common in high-availability (HA) systems, disaster recovery (DR) strategies, and fault-tolerant networks.

Active-Active Architecture (All Nodes Live)

In an active-active configuration, all servers (or data centers) are online and actively handling requests at the same time.

Traffic is distributed across every node, often via a load balancer, so no single machine bears the entire load.

If one node fails, the others seamlessly pick up its share of traffic, providing high fault tolerance and continuous availability.

Active-active clusters are highly scalable: you can simply add more servers to increase capacity and throughput.

In practice, active-active is used in cloud services, large websites, and distributed databases where consistent performance and minimal downtime are critical.

  • Load balancing: Incoming requests are split across all active nodes, often by a dedicated load balancer using algorithms (round-robin, weighted, etc.).

  • Performance: Because each node shares the workload, individual servers run at lower utilization and respond faster. Overall throughput is high and grows with each added node.

  • Fault tolerance: No single point of failure exists. If one server goes down, others continue serving traffic with little or no interruption. Users typically don’t notice an outage, giving “effectively uninterrupted service”.

  • Scalability: Easy horizontal scaling, just add more identical nodes. Active-active systems can handle growing user bases or traffic spikes by expanding the cluster.

Active-active systems maximize uptime and performance, but they require more hardware and careful design.

Maintaining data consistency across active nodes (e.g. in databases) can be complex.

For example, a globally distributed database might use active-active mode so each region has a local copy (low latency) yet keep all data synchronized.

The trade-off is higher cost and complexity: you need robust load balancers, failover logic, and synchronization, and you pay for multiple fully-provisioned servers.

Active-Passive Architecture (Primary + Standby)

By contrast, an active-passive setup has only one node actively handling traffic at a time, while other nodes sit idle as standby backups.

The primary (active) server does all the work under normal conditions, and each passive node is kept up-to-date but doesn’t process client requests.

The passive servers are essentially on standby: if the primary fails, one of the passives is promoted to active status to take over.

  • Failover process: When failure is detected (e.g. via a heartbeat signal), the system automatically switches traffic to the standby node. This switchover can cause a short interruption, from a few seconds to a couple of minutes, as the passive node becomes active. During that brief downtime, users may see errors or delays until the new primary is fully in charge.

  • Resource usage: The standby servers consume resources without doing useful work until needed. In other words, active-passive wastes some capacity: passive nodes sit idle, using power and memory without serving traffic. However, this simplicity often means lower infrastructure costs.

  • Simplicity: Active-passive is generally easier to configure and maintain than active-active, because only the primary handles operations. There’s no need for continuous load balancing or complex multi-master synchronization. For example, many traditional databases and applications use an active-passive model with a primary database and a read-only replica (the passive) for disaster recovery.

  • Disaster recovery: Passive nodes are often placed in different data centers or regions for resilience. For example, a company might run its primary servers on-premises and keep passive replicas in the cloud (AWS/Azure). If the main site fails (network outage, natural disaster, etc.), failover to the remote passive site restores service. This geographic separation ensures that even a site-wide outage can be overcome.

Active-passive prioritizes reliability over continuous performance.

It greatly improves availability compared to a single-server setup (since a standby is ready), but it cannot serve load with the standby until a failure occurs.

Many mission-critical systems (financial transactions, patient monitoring) use active-passive when absolute uptime is needed but full active-active complexity is unnecessary.

It’s often a cost-effective first step toward redundancy: startups or smaller companies frequently begin with one active server and a failover backup, then move to active-active as demand grows.

Active-active and Active-Passive Architecture
Active-active and Active-Passive Architecture

Key Differences and Trade-Offs

Active-active and active-passive architectures differ in how they allocate work, handle failures, and use resources.

The main contrasts are:

  • Workload Distribution: In active-active, all nodes actively serve requests and share the load. By contrast, in active-passive, the primary handles all traffic and backups wait in standby.

  • Performance and Throughput: Active-active yields higher throughput and better performance under normal operations, since multiple nodes process data in parallel. Active-passive has lower performance in normal mode (only one server working), though a passive node can sometimes handle read-only tasks (like serving cached data) to offload the primary. However, true write performance is limited by the single active node.

  • Resource Utilization: Active-active maximizes hardware utilization. No server is idle. This means you get more capacity for a given investment. Active-passive deliberately under-utilizes hardware: one server handles traffic while the others are idle, so overall resource efficiency is lower.

  • Fault Tolerance and Downtime: Active-active provides near-continuous availability. If one node fails, other active nodes immediately handle its share, often with virtually no downtime. Active-passive provides high availability too, but depends on a failover process. There is typically a brief outage during switchover, so downtime is not entirely eliminated. Still, even this short failover time is far better than a single-server outage.

  • Scalability: Active-active scales well. Adding more active nodes linearly increases capacity. Active-passive is limited by the single active node. Scalability means upgrading the active server or switching to a larger standby, which is often manual and limited.

  • Complexity and Cost: Active-active is more complex and expensive. You need multiple full-capacity servers (or data centers), and mechanisms to synchronize state and distribute load. Active-passive is simpler and cheaper since only one server does work at a time, and passives can be smaller or powered-down. According to experts, active-active delivers “strong performance and reduced downtime” but at higher hardware and management cost, whereas active-passive is a “more budget-friendly option” with some performance trade-offs.

Choosing between them depends on needs: active-active is favored when uptime and performance are paramount, while active-passive is chosen when cost or simplicity is a concern.

For example, high-traffic e-commerce sites or global services often run active-active to handle millions of users with no single point of failure.

In contrast, many legacy systems or mid-size businesses use active-passive to achieve reliability without the complexity (e.g. a primary database with a passive replica).

Practical Examples and Scenarios

  • Web Servers: An active-active setup might have two or more web servers behind a load balancer. Both servers handle HTTP requests at the same time. If one web server crashes, the other continues serving users without interruption. In active-passive, there would be one live web server and one standby. The standby might not accept traffic unless the primary fails, at which point it takes over.

  • Database Clusters: In active-active database systems (sometimes called multi-master), each replica accepts reads and writes. Companies like financial trading platforms might use this across data centers so transactions can occur in parallel worldwide. In active-passive databases (master-slave replication), all writes go to the master; the slave stays synchronized but read-only and takes over only on failover. Many relational databases (e.g. primary-standby setups) follow this model.

  • Analogies: Think of staffing as an analogy. Active-active is like having two cashiers at a checkout who both serve customers at once. Service is faster, and if one cashier calls in sick, the other keeps working with no line. Active-passive is like having one cashier with another person waiting to start only if the first one needs a break. The second person is ready but not helping until the first fails.

  • Other Systems: Any system requiring high reliability can use these patterns. For example, power supplies or routers can be set up active-active (both share traffic) or active-passive (one is backup). The concept applies broadly: active-active for parallel operation, active-passive for standby redundancy.

What Are RPO and RTO, and How Do They Differ in Disaster Recovery Planning?
What Is Graceful Degradation, and How Do Feature Flags Help Availability?
Mark as Completed

On this page

Active-Active Architecture (All Nodes Live)

Active-Passive Architecture (Primary + Standby)

Key Differences and Trade-Offs

Practical Examples and Scenarios